Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Add  a  User  to  a  Group  if  That  User  Belongs  to  Two  Other  Groups  

 Content of Add a User to a Group if That User Belongs to Two Other Groups.vbs
MD5 Hash: 4FF230126051E9E516FB410AB1EAC88A
On Error Resume Next

Set objUser = GetObject("LDAP://cn=Ken Myer,ou=Finance,dc=fabrikam,dc=com")

i = 0

For Each strGroup in objUser.memberOf
Set objGroup = GetObject("LDAP://" & strGroup)
If objGroup.CN = "Finance Users" Then
i = i + 1
End If
If objGroup.CN = "Fabrikam Managers" Then
i = i + 1
End If
Next

If i = 2 Then
Set objGroup = GetObject("LDAP://cn=Finance Managers,ou=Finance,dc=fabrikam,dc=com")
objGroup.Add(objUser.ADsPath)
End If



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a